<!DOCTYPE html>
<html><head>
  <meta charset="utf-8">
  <title>{$title}</title>
  <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">

<link rel="stylesheet" href="css/mui.min.css">

  <style type="text/css">
   #list {
    /*避免导航边框和列表背景边框重叠，看起来像两条边框似得；*/
    margin-top: -1px;
   }
   .mui-bar .mui-pull-left .mui-icon {
    padding-right: 5px;
    font-size: 28px;
   }
   .mui-bar .mui-btn {
    font-weight: normal;
    font-size: 17px;
   }
   .mui-bar .mui-btn-link {
    top: 1px;
   }
   .mui-scroll { height: 28px; line-height: 28px; overflow: hidden;}
   .mui-scroll a{padding: 5px;}
   .red{
	color:#FF0000;
}
   .no{ background-color:#FFFFFF}
   .mui-content-padded {
				margin-top: 25px;
			}
			 .hy-box{background-color:#FFFFFF; padding:10px;}
			 .mui-input-row{margin:5px; padding:10px;}
  </style>
 </head>

 <body>
<header id="header" class="mui-bar mui-bar-nav">
  <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
   <h1 class="mui-title" id="mui-title">充值中心</h1>
</header>
<div style="margin-top:60px;margin-bottom:60px;">
<form class="mui-input-group" action="https://www.ysv8.com/pay.php" method="post">
<input name="title" type="hidden" value="一生V8金币充值">
<input name="url" type="hidden" id="url" value="https://www.ysv8.com/mui/my.html">
<input name="uid" id="uid" type="hidden" value="0">
<div class="mui-input-row"><label>充值帐号</label><input name="user" id="user" type="text" value="" disabled="disabled"></div>
<div class="mui-input-row"><label>充值数量</label><input name="gold" type="text" id="gold" class="mui-input" value="10000" style="border: thin solid #CCCCCC;" onChange="rmbc(this)">（1人民币=100金币）</div>
<div class="mui-input-row"><label>预留信息</label><input name="mob" id="mob" value="123456" class="mui-input" type="text"  style="border: thin solid #CCCCCC;">（手机充值为手机号，微信为微信号，支付宝为支付宝号）</div>
<div class="mui-input-row"><label>充值方式</label>充值方式：支付宝</div>
<div class="mui-input-row"><label>应付金额</label><span class="red" id="rmb">100元</span></div>
<div style="text-align:center; padding:10px;"><button class="mui-btn mui-btn-primary" type="submit">充值</button></div>

</form>			</div>

<div id="logindiv" class="mui-popover mui-popover-bottom mui-popover-action">
<div class="hy-box" style="font-size: 16px;">
<form class="mui-input-group" action="/ap.php">
<div class="mui-input-row"><label>账号</label><input id='user' type="text" class="mui-input" placeholder="请输入账号"></div>
<div class="mui-input-row"><label>密码</label><input id='pass1' type="password" class="mui-input" placeholder="请输入密码"></div>
<div class="mui-input-row" id="pass2d"><label>重复密码</label><input id='pass2' type="password" class="mui-input" placeholder="请再次输入密码"></div>	
<div class="mui-input-row" id="emaild"><label>邮箱</label><input id='email' type="text" class="mui-input" placeholder="请输入您的邮箱"></div>	
</form>		
<div class="mui-content-padded"><button id='loginb' class="mui-btn mui-btn-block mui-btn-primary">登录</button><a id='add'>注册账号</a></div>

</div>
</div>	
</div>	
<script src="js/mui.min.js"></script>
<script src="config.js"></script>	
<script>
mui.init({
			swipeBack:true //启用右滑关闭功能
		});
var url=getQueryString("q")
if(url!= null){
document.getElementById('url').value=url;
}
var loginButton = document.getElementById('loginb');
var regid='login';
var islogin=false;
function rmbc(obj){
document.getElementById("rmb").innerHTML=obj.value/100+'元';
}
 function regdiv(){
 if(regid=='login'){
document.getElementById("emaild").style.display="none";
document.getElementById("pass2d").style.display="none";
 }else if(regid=='add'){
 document.getElementById("emaild").style.display="inline";
document.getElementById("pass2d").style.display="inline";
 }
 
 }
function setdata(data){
if(data['error']){
islogin=true;
document.getElementById('user').value=data['my']['user'];
document.getElementById('uid').value=data['my']['id'];
}else{
if(data['info']){
mui.alert(data['info']);
}
islogin=false;
document.getElementById('mui-title').innerText="请登录";
document.getElementById('gold').innerText="请登录";
	  var gethtml=regdiv();
	  mui('#logindiv').popover('toggle');
}

}

mui(".mui-reglogin").on('tap','a',function(){
id = this.getAttribute("id");
if(id=="regandlog"){
var gethtml=regdiv();
  mui('#logindiv').popover('toggle');
  }
  
  if(id=="out"){
mui.post('https://www.ysv8.com/open/user',{type:'out',YSV8_HEX:ysv8hex},function(data){
 setdata(data);
 });
  }
  
});
 
mui(".mui-content-padded").on('tap','a',function(){
id = this.getAttribute("id");
var idinner=this.innerText;
this.id=regid;
regid=id;
var gethtml=regdiv();
this.innerText=loginButton.innerText;
loginButton.innerText=idinner;
});	   


mui(".mui-content-padded").on('tap','button',function(){
 mui.post('https://www.ysv8.com/open/user',{user:document.getElementById("user").value,pass1:document.getElementById("pass1").value,pass2:document.getElementById("pass2").value,email:document.getElementById("email").value,type:regid},function(data){
 setdata(data);
 mui('#logindiv').popover('toggle');
 });


});	
  mui(".mui-bar-tab").on('tap','.mui-tab-item',function(){
id = this.getAttribute("her");
if(id){
mui.openWindow({
url: id, 
id:id
});
}
});	   
  mui(".mui-row").on('tap','a',function(){
id = this.getAttribute("her");
mui.openWindow({
url: id, 
id:'nav'
});
});	
(function($) {
$.ready(function() {
setTimeout(function() {mui.post('https://www.ysv8.com/open/user',{type:'get',YSV8_HEX:ysv8hex},function(data){setdata(data);});}, 500);
  });
})(mui);  
  </script>
 </body>

</html>
